package com.utils.network.api;

public class ApiResponse<T> {
    private int errorCode;
    private String errorMsg;
    private T data;
    /*标记请求是否成功*/
    private boolean ok = true;

    public ApiResponse() {
    }

    public ApiResponse(int pCode, String pMessage, T pData) {
        errorCode = pCode;
        errorMsg = pMessage;
        data = pData;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int pErrorCode) {
        errorCode = pErrorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String pErrorMsg) {
        errorMsg = pErrorMsg;
    }

    public T getData() {
        return data;
    }

    public void setData(T pData) {
        data = pData;
    }

    public int getCode() {
        return errorCode;
    }

    public String getMessage() {
        return errorMsg;
    }

    public boolean isOk() {
        return ok;
    }

    public void setOk(boolean pOk) {
        ok = pOk;
    }
}
